<?php 
    $conn = oci_connect("hospital", "hospital", "//localhost/XE"); 
	$pull = oci_parse($conn, "select stf_id from staff where stf_id = $_POST[stf_id]");
	$total = 0;
	oci_execute($pull);
	$total = oci_fetch_all($pull,$result);
	
	if( $total != 0){
		echo "This  ID  is already have";
	}else{
		$add = oci_parse($conn, "INSERT INTO STAFF VALUES('$_POST[stf_id]','$_POST[f_name]','$_POST[l_name]',
		'$_POST[job_type]','$_POST[salary]','$_POST[startcontract]','$_POST[endcontract]')");
		oci_execute($add);
                
                    $addn = oci_parse($conn, "INSERT INTO EXECUTIVES VALUES('$_POST[stf_id]')");
                    oci_execute($addn);
               
	}
 ?>
 
<html>
<head><meta http-equiv="refresh" content="1; URL=main.php"></head>
<BODY bgcolor = "#ffffff">
 <font color="#ffffff" size="20">Redirecting ...</font>
 </body>
 </html>